﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ViewAll.ascx.cs" Inherits="Team4Mock.UserControl.Department.ViewAll" %>

<style type="text/css">
    .style1
    {
        width: 177px;
    }
    .style2
    {
        width: 151px;
    }
    #txtBusID
    {
        width: 108px;
    }
    #txtContactID
    {
        width: 105px;
    }
</style>
<script type="text/javascript">
    function getContactID() {
        var s = document.getElementById('id').value;
        if (s != "") {
            document.getElementById('<%=idContact.ClientID%>').value = s;
        }

        var b = document.getElementById('idBus').value;
        if (b != "") {
            document.getElementById('<%=hdidBus.ClientID%>').value = b;
        }
        var p = document.getElementById('txtPostCode').value;
        if (p != "") {
            document.getElementById('<%=PostCode.ClientID%>').value = p;
        }
        var t = document.getElementById('txtTown').value;
        if (t != "") {
            document.getElementById('<%=Town.ClientID%>').value = t;
        }
        var c = document.getElementById('txtCounty').value;
        if (c != "") {
            document.getElementById('<%=County.ClientID%>').value = c;
        }
        var sic = document.getElementById('txtSICCode').value;
        if (sic != "") {
            document.getElementById('<%=hdsic.ClientID%>').value = sic;
        }
    }
</script>
<script type="text/javascript">
    function PopupBusiness() {
        window.open("/FormView/PopupBusiness.aspx", 'popUpWindow', 'height=500,width=800,left=300,top=100,resizable=No,scrollbars=No,toolbar=no,menubar=no,location=no,directories=no, status=No');
    }
    function PopupAddress() {
        window.open("/FormView/PopupAddress.aspx", 'popUpWindow', 'height=500,width=800,left=300,top=100,resizable=No,scrollbars=No,toolbar=no,menubar=no,location=no,directories=no, status=No');
    }
    function PopupContact() {
        window.open("/FormView/PopupContact.aspx", 'popUpWindow', 'height=500,width=800,left=300,top=100,resizable=No,scrollbars=No,toolbar=no,menubar=no,location=no,directories=no, status=No');
    }
    
</script>

<fieldset style="width: 768px">
    <div style="width: 770px;">
        <ul class="tabs" style="width: 779px; float: left;">
            <li><a href="#" class="active tab">Department Details</a></li>
        </ul>
        <br />
        <div class="tab_container">
            <div id="#" class="tab_content">
                <table width="765px" cellpadding="0px" cellspacing="0px" border="0" style="font-size: 15px;">
                    <tr>
                        <td class="style1">
                            Department Name <span style="color: Red;">(*)</span>
                        </td>
                        <td class="style9">
                            <asp:TextBox ID="txtPartName" runat="server" Width="186px"></asp:TextBox>
                        </td>
                        <td class="style2">
                            Type of Business <span style="color: Red;">(*)</span>
                        </td>
                        <td>
                            <input type="text" id="txtBusID" readonly="readonly" />
                        &nbsp;&nbsp;<a href="#" onclick="PopupBusiness();return false;">Lookup</a>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1">
                            Department Short Description
                        </td>
                        <td class="style13">
                            <asp:TextBox ID="txtDesShort" runat="server" TextMode="MultiLine" Height="63px" Width="186px"
                                Style="margin-left: 0px"></asp:TextBox>
                        </td>
                        <td class="style2">
                            SIC Code
                        </td>
                        <td>
                            <input type="text" id="txtSICCode" readonly="readonly" style="width: 176px;">
                            <input type="hidden" id="idBus">
                            <asp:HiddenField ID="hdidBus" runat="server" />
                            <asp:HiddenField ID="hdsic" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td class="style1">
                            Lead Contact
                        </td>
                        <td>
                            <input type="text" id="Name" readonly="readonly" style="width: 104px" />
                            <input type="hidden" id="id" />
                            &nbsp;&nbsp; <a href="#" onclick="PopupContact();return false;">Lookup</a>
                            <asp:HiddenField ID="idContact" runat="server" />
                        </td>
                        <td class="style2">
                            BU/Directorate Full Description
                        </td>
                        <td>
                            <asp:TextBox ID="txtDesFull" runat="server" TextMode="MultiLine" Height="63px" Width="177px"
                                Style="margin-left: 0px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                    <td>
                    Copy Address From
                    </td>
                        <td>
                            <asp:RadioButton runat="server" GroupName="copyfrom" ID="rdOrg" Text="Organisation"/>
                            <asp:RadioButton runat="server" GroupName="copyfrom" ID="rdParent" Text="Parent"/>
                        </td>
                        <td class="style2">
                            Phone Number
                        </td>
                        <td>
                            <asp:TextBox ID="txtPhone" runat="server" Width="180px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1">
                            Address Line 1 <span style="color: Red;">(*)</span>
                        </td>
                        <td>
                            <asp:TextBox ID="txtAdd1" runat="server" Width="186px"></asp:TextBox>
                        </td>
                        <td class="style2">
                            Fax
                        </td>
                        <td>
                            <asp:TextBox ID="txtFax" runat="server" Width="180px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1">
                            Address Line 2
                        </td>
                        <td>
                            <asp:TextBox ID="txtAdd2" runat="server" Width="186px"></asp:TextBox>
                        </td>
                        <td class="style2">
                            &nbsp;Web Address
                        </td>
                        <td>
                            <asp:TextBox ID="txtWeb" runat="server" Width="180px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1">
                            Address Line 3
                        </td>
                        <td>
                            <asp:TextBox ID="txtAdd3" runat="server" Width="186px"></asp:TextBox>
                        </td>
                        <td class="style2">
                            Charity Number
                        </td>
                        <td>
                            <asp:TextBox ID="txtCharNum" runat="server" Width="180px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1">
                            Post Code <span style="color: Red;">(*)</span>
                        </td>
                        <td>
                            <input type="text" id="txtPostCode" style="width: 117px;" />
                            &nbsp;&nbsp;<a href="#" onclick="PopupAddress();return false;">Lookup</a>
                            <asp:HiddenField ID="PostCode" runat="server" />
                        </td>
                        <td class="style2">
                            Company Number</td>
                        <td>
                            <asp:TextBox ID="txtComNum" runat="server" Width="180px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1">
                            Town/Village/City
                        </td>
                        <td>
                            <input type="text" id="txtTown" style="width: 186px;" />
                            <asp:HiddenField ID="Town" runat="server" />
                        </td>
                        <td class="style2">
                            &nbsp;Nation/Country
                        </td>
                        <td>
                            <asp:DropDownList ID="dlCountry" AutoPostBack="false" DataTextField="CountryName"
                            DataValueField="CountryName" runat="server" Width="186px">
                        </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1">
                            County
                        </td>
                        <td>
                            <input type="text" id="txtCounty" style="width: 186px;" />
                            <asp:HiddenField ID="County" runat="server" />
                        </td>
                        <td class="style2">
                            Is Active</td>
                        <td>
                            <asp:CheckBox runat="server" ID="ckIsActive"/>
                            </td>
                    </tr>
                </table>
            </div>
        </div>
        <asp:Button ID="btnSave" runat="server" Text="Save" CssClass="button" OnClientClick="getContactID()" onclick="btnSave_Click" />
        <asp:Button ID="btnBack" runat="server" Text="Back" CssClass="button" 
            onclick="btnBack_Click" /><br/>
            <asp:Label runat="server" ID="tb"></asp:Label>
    </div>
</fieldset>